import Vue from 'vue'
import VueClipboard from 'vue-clipboard2'
Vue.use(VueClipboard)

declare module 'vue/types/vue' {
  interface Vue {
    $wCopy(message: string): void
  }
}

Vue.prototype.$wCopy = function (text: string) {
  this.$copyText(text).then(
    () => {
      this.$message.success('拷贝成功')
    },
    () => {
      this.$message.error('拷贝失败')
    }
  )
}
